#include "Comm.hpp"
int main()
{
    int fd = open(PATH, O_WRONLY);
    string inbuffer;
    while (true)
    {
        cout << "Please input your message# ";
        getline(cin, inbuffer);
        if (inbuffer == "quit")
            break;
        int n = write(fd, inbuffer.c_str(), inbuffer.size());
        if (n < 0)
        {
            cerr << "write fail, errno is " << errno << "errstring is " << strerror(errno) << endl;
            break;
        }
    }
    close(fd);
    return 0;
}